3.5 \(\int \csc (x) (a \cos (x)+b \sin (x)) \, dx\)

Optimal. Leaf size=9 \[ a \log (\sin (x))+b x \]

[Out]

b*x+a*ln(sin(x))

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3085, 3475} \[ a \log (\sin (x))+b x \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]*(a*Cos[x] + b*Sin[x]),x]

[Out]

b*x + a*Log[Sin[x]]

Rule 3085

Int[sin[(c_.) + (d_.)*(x_)]^(m_)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Symb
ol] :> Int[(b + a*Cot[c + d*x])^n, x] /; FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && IntegerQ[n] && NeQ[a^2 + b
^2, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc (x) (a \cos (x)+b \sin (x)) \, dx &=\int (b+a \cot (x)) \, dx\\ &=b x+a \int \cot (x) \, dx\\ &=b x+a \log (\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 9, normalized size = 1.00 \[ a \log (\sin (x))+b x \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]*(a*Cos[x] + b*Sin[x]),x]

[Out]

b*x + a*Log[Sin[x]]

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 11, normalized size = 1.22 \[ b x + a \log \left (\frac {1}{2} \, \sin \relax (x)\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="fricas")

[Out]

b*x + a*log(1/2*sin(x))

________________________________________________________________________________________

giac [B]  time = 0.21, size = 24, normalized size = 2.67 \[ b x - a \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) + a \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="giac")

[Out]

b*x - a*log(tan(1/2*x)^2 + 1) + a*log(abs(tan(1/2*x)))

________________________________________________________________________________________

maple [A]  time = 0.45, size = 10, normalized size = 1.11 \[ b x +a \ln \left (\sin \relax (x )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)*(a*cos(x)+b*sin(x)),x)

[Out]

b*x+a*ln(sin(x))

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 9, normalized size = 1.00 \[ b x + a \log \left (\sin \relax (x)\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x, algorithm="maxima")

[Out]

b*x + a*log(sin(x))

________________________________________________________________________________________

mupad [B]  time = 0.54, size = 54, normalized size = 6.00 \[ a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )-a\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )-b\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )\,1{}\mathrm {i}+b\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(x) + b*sin(x))/sin(x),x)

[Out]

a*log(tan(x/2)) - a*log(tan(x/2) - 1i) - a*log(tan(x/2) + 1i) - b*log(tan(x/2) - 1i)*1i + b*log(tan(x/2) + 1i)
*1i

________________________________________________________________________________________

sympy [A]  time = 1.14, size = 8, normalized size = 0.89 \[ a \log {\left (\sin {\relax (x )} \right )} + b x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)*(a*cos(x)+b*sin(x)),x)

[Out]

a*log(sin(x)) + b*x

________________________________________________________________________________________